Fork me on GitHub

smartd的安装及使用

smartd是一个守护进程(一个帮助程序),它能监视拥有自我监视,分析和汇报技术(Self-Monitoring, Analysis, and Reporting Technology - SMART)的硬盘。 SMART系统使得硬盘能监视并汇报自己的运行状况。它的一个重要特性是能够预测失败,使得系统管理员能避免数据丢失。

安装

smartmontools包含 smartctl 和 smartd 两个程序,前者是前台命令行工具、后者是后台运行程序

1
apt-get install smartmontools

安装好之后先检查一下硬盘是否具有smart特性

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartctl -i /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.14 (AF)
Device Model: ST1000DM003-1SB102
Serial Number: Z9ARYZYS
LU WWN Device Id: 5 000c50 0b0cc93ae
Firmware Version: CC63
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Tue Nov 20 15:25:54 2018 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

然后检查一下硬盘状况

如果下面的结果不是 PASSED 的话你需要立刻警觉起来,马上备份所有数据,硬盘随时都可能出问题(不过值得注意的是就算结果是 PASSED 并不意味着硬盘100%就安全,PASS 不能代表没问题,没 PASS 代表一定有问题)

1
2
3
4
5
6
7
8
smartctl -H /dev/sda
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartctl -H /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

可以做一个快速检查

1
2
smartctl -t short /dev/sda
smartctl -l selftest /dev/sda (看进度和结果)

smartd使用

教程 https://linux.die.net/man/8/smartd

smartd是一个监视自我监控的守护进程( a daemon that monitors the Self-Monitoring),通过syslog接口记录SMART的错误和变化,还可以配置成为:如果检测到问题就发电子邮件警告。

smartd is a daemon that monitors the Self-Monitoring, Analysis and Reporting Technology (SMART) system built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Usage: smartd [options]
-A PREFIX, --attributelog=PREFIX
Log ATA attribute information to {PREFIX}MODEL-SERIAL.ata.csv
[default is /var/lib/smartmontools/attrlog.MODEL-SERIAL.ata.csv]
-B [+]FILE, --drivedb=[+]FILE
Read and replace [add] drive database from FILE
[default is +/etc/smart_drivedb.h
and then /var/lib/smartmontools/drivedb/drivedb.h]
-c NAME|-, --configfile=NAME|-
Read configuration file NAME or stdin
[default is /etc/smartd.conf]
-C, --capabilities
Drop unneeded Linux process capabilities.
Warning: Mail notification does not work when used.
-d, --debug
Start smartd in debug mode
-D, --showdirectives
Print the configuration file Directives and exit
-h, --help, --usage
Display this help and exit
-i N, --interval=N
Set interval between disk checks to N seconds, where N >= 10
-l local[0-7], --logfacility=local[0-7]
Use syslog facility local0 - local7 or daemon [default]
-n, --no-fork
Do not fork into background
-p NAME, --pidfile=NAME
Write PID file NAME
-q WHEN, --quit=WHEN
Quit on one of: nodev, errors, nodevstartup, never, onecheck, showtests
-r, --report=TYPE
Report transactions for one of: ioctl[,N], ataioctl[,N], scsiioctl[,N], nvmeioctl[,N]
-s PREFIX, --savestates=PREFIX
Save disk states to {PREFIX}MODEL-SERIAL.TYPE.state
[default is /var/lib/smartmontools/smartd.MODEL-SERIAL.TYPE.state]
-w NAME, --warnexec=NAME
Run executable NAME on warnings
[default is /usr/share/smartmontools/smartd_warning.sh]
-V, --version, --license, --copyright
Print License, Copyright, and version information

自动报警

在smartd.conf里面已经配置了很多监视的操作 可以通过取消注释的方式启动它们

1
2
3
4
5
6
7
8
9
10
11
vi /etc/smartd.conf
打开后里面大部分都是被注释掉的说明
# Monitor all attributes except normalized Temperature (usually 194),
# but track Temperature changes >= 4 Celsius, report Temperatures
# >= 45 Celsius and changes in Raw value of Reallocated_Sector_Ct (5).
# Send mail on SMART failures or when Temperature is >= 55 Celsius.
#/dev/sdc -a -I 194 -W 4,45,55 -R 5 -m admin@example.com
# A very silent check. Only report SMART health status if it fails
# But send an email in this case
#/dev/sdc -H -C 0 -U 0 -m admin@example.com

Examples

smartd
Runs the daemon in forked mode. This is the normal way to run smartd. Entries are logged to SYSLOG.

smartd -d -i 30
Run in foreground (debug) mode, checking the disk status every 30 seconds.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
smartd 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
Opened configuration file /etc/smartd.conf
Drive: DEVICESCAN, implied '-a' Directive on line 21 of file /etc/smartd.conf
Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
glob(3) found no matches for pattern /dev/hd[a-t]
glob(3) found no matches for pattern /dev/sd[a-c][a-z]
Device: /dev/sda, type changed from 'scsi' to 'sat'
Device: /dev/sda [SAT], opened
Device: /dev/sda [SAT], ST1000DM003-1SB102, S/N:Z9ARYZYS, WWN:5-000c50-0b0cc93ae, FW:CC63, 1.00 TB
Device: /dev/sda [SAT], found in smartd database: Seagate Barracuda 7200.14 (AF)
Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Device: /dev/sda [SAT], state read from /var/lib/smartmontools/smartd.ST1000DM003_1SB102-Z9ARYZYS.ata.state
Device: /dev/sdb, type changed from 'scsi' to 'sat'
Device: /dev/sdb [SAT], opened
Device: /dev/sdb [SAT], INTEL SSDSC2KW256G8, S/N:PHLA8235067W256CGN, WWN:5-5cd2e4-14f90188b, FW:LHF002C, 256 GB
Device: /dev/sdb [SAT], not found in smartd database.
Device: /dev/sdb [SAT], can't monitor Current_Pending_Sector count - no Attribute 197
Device: /dev/sdb [SAT], can't monitor Offline_Uncorrectable count - no Attribute 198
Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Device: /dev/sdb [SAT], state read from /var/lib/smartmontools/smartd.INTEL_SSDSC2KW256G8-PHLA8235067W256CGN.ata.state
Monitoring 2 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
Device: /dev/sda [SAT], opened ATA device
Device: /dev/sda [SAT], previous self-test completed without error
Device: /dev/sdb [SAT], opened ATA device
Device: /dev/sdb [SAT], previous self-test completed without error
Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.ST1000DM003_1SB102-Z9ARYZYS.ata.state
Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.INTEL_SSDSC2KW256G8-PHLA8235067W256CGN.ata.state
^CDevice: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.ST1000DM003_1SB102-Z9ARYZYS.ata.state
Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.INTEL_SSDSC2KW256G8-PHLA8235067W256CGN.ata.state
Signal INT - rereading configuration file /etc/smartd.conf (CONTROL-\ quits)
Opened configuration file /etc/smartd.conf
Drive: DEVICESCAN, implied '-a' Directive on line 21 of file /etc/smartd.conf
Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
glob(3) found no matches for pattern /dev/hd[a-t]
glob(3) found no matches for pattern /dev/sd[a-c][a-z]
Device: /dev/sda, type changed from 'scsi' to 'sat'
Device: /dev/sda [SAT], opened
Device: /dev/sda [SAT], ST1000DM003-1SB102, S/N:Z9ARYZYS, WWN:5-000c50-0b0cc93ae, FW:CC63, 1.00 TB
Device: /dev/sda [SAT], found in smartd database: Seagate Barracuda 7200.14 (AF)
Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Device: /dev/sda [SAT], state read from /var/lib/smartmontools/smartd.ST1000DM003_1SB102-Z9ARYZYS.ata.state
Device: /dev/sdb, type changed from 'scsi' to 'sat'
Device: /dev/sdb [SAT], opened
Device: /dev/sdb [SAT], INTEL SSDSC2KW256G8, S/N:PHLA8235067W256CGN, WWN:5-5cd2e4-14f90188b, FW:LHF002C, 256 GB
Device: /dev/sdb [SAT], not found in smartd database.
Device: /dev/sdb [SAT], can't monitor Current_Pending_Sector count - no Attribute 197
Device: /dev/sdb [SAT], can't monitor Offline_Uncorrectable count - no Attribute 198
Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Device: /dev/sdb [SAT], state read from /var/lib/smartmontools/smartd.INTEL_SSDSC2KW256G8-PHLA8235067W256CGN.ata.state
Monitoring 2 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
Device: /dev/sda [SAT], opened ATA device
Device: /dev/sdb [SAT], opened ATA device
Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.ST1000DM003_1SB102-Z9ARYZYS.ata.state
Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.INTEL_SSDSC2KW256G8-PHLA8235067W256CGN.ata.state

smartd -q onecheck
Registers devices, and checks the status of the devices exactly once. The exit status (the bash $? variable) will be zero if all went well, and nonzero if no devices were detected or some other problem was encountered.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartd -q onecheck
smartd 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
Opened configuration file /etc/smartd.conf
Drive: DEVICESCAN, implied '-a' Directive on line 21 of file /etc/smartd.conf
Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
glob(3) found no matches for pattern /dev/hd[a-t]
glob(3) found no matches for pattern /dev/sd[a-c][a-z]
Device: /dev/sda, type changed from 'scsi' to 'sat'
Device: /dev/sda [SAT], opened
Device: /dev/sda [SAT], ST1000DM003-1SB102, S/N:Z9ARYZYS, WWN:5-000c50-0b0cc93ae, FW:CC63, 1.00 TB
Device: /dev/sda [SAT], found in smartd database: Seagate Barracuda 7200.14 (AF)
Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Device: /dev/sda [SAT], state read from /var/lib/smartmontools/smartd.ST1000DM003_1SB102-Z9ARYZYS.ata.state
Device: /dev/sdb, type changed from 'scsi' to 'sat'
Device: /dev/sdb [SAT], opened
Device: /dev/sdb [SAT], INTEL SSDSC2KW256G8, S/N:PHLA8235067W256CGN, WWN:5-5cd2e4-14f90188b, FW:LHF002C, 256 GB
Device: /dev/sdb [SAT], not found in smartd database.
Device: /dev/sdb [SAT], can't monitor Current_Pending_Sector count - no Attribute 197
Device: /dev/sdb [SAT], can't monitor Offline_Uncorrectable count - no Attribute 198
Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Device: /dev/sdb [SAT], state read from /var/lib/smartmontools/smartd.INTEL_SSDSC2KW256G8-PHLA8235067W256CGN.ata.state
Monitoring 2 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
Device: /dev/sda [SAT], opened ATA device
Device: /dev/sda [SAT], previous self-test completed without error
Device: /dev/sdb [SAT], opened ATA device
Device: /dev/sdb [SAT], previous self-test completed without error
Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.ST1000DM003_1SB102-Z9ARYZYS.ata.state
Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.INTEL_SSDSC2KW256G8-PHLA8235067W256CGN.ata.state
Started with '-q onecheck' option. All devices sucessfully checked once.
smartd is exiting (exit status 0)

smartctl使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
Usage: smartctl [options] device
============================================ SHOW INFORMATION OPTIONS =====
-h, --help, --usage
Display this help and exit
-V, --version, --copyright, --license
Print license, copyright, and version information and exit
-i, --info
Show identity information for device
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartctl -i /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: INTEL SSDSC2KW256G8
Serial Number: PHLA8235067W256CGN
LU WWN Device Id: 5 5cd2e4 14f90188b
Firmware Version: LHF002C
User Capacity: 256,060,514,304 bytes [256 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 (minor revision not indicated)
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Tue Nov 20 16:48:02 2018 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
--identify[=[w][nvb]]
Show words and bits from IDENTIFY DEVICE data (ATA)
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartctl --identify /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== ATA IDENTIFY DATA ===
Word Bit Value Description
0 - 0x0040 General configuration
0 6 1 Not removable controller and/or device [OBS-6]
1 - 0x3fff Cylinders [OBS-6]
2 - 0xc837 Specific configuration (0x37c8/738c/8c73/c837)
3 - 0x0010 Heads [OBS-6]
6 - 0x003f Sectors per track [OBS-6]
10-19 - . Serial number (String)
10-13 . 0x5048:4c41:3832:3335 "PHLA8235"
14-17 . 0x3036:3757:3235:3643 "067W256C"
18-19 . 0x474e:2020 "GN "
23-26 - . Firmware revision (String)
23-26 . 0x204c:4846:3030:3243 " LHF002C"
27-46 - . Model number (String)
27-30 . 0x494e:5445:4c20:5353 "INTEL SS"
31-34 . 0x4453:4332:4b57:3235 "DSC2KW25"
35-38 . 0x3647:3820:2020:2020 "6G8 "
39-42 . 0x2020:2020:2020:2020 " "
43-46 . 0x2020:2020:2020:2020 " "
-g NAME, --get=NAME
Get device setting: all, aam, apm, lookahead, security, wcache, rcache, wcreorder
-a, --all
Show all SMART information for device
-x, --xall
Show all information for device
显示信息很多 还包括了温度
SCT Status Version: 3
SCT Version (vendor specific): 522 (0x020a)
SCT Support Level: 1
Device State: Active (0)
Current Temperature: 35 Celsius
Power Cycle Min/Max Temperature: 24/35 Celsius
Lifetime Min/Max Temperature: 22/39 Celsius
Under/Over Temperature Limit Count: 0/0
--scan
Scan for devices
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
--scan-open
Scan for devices and try to open each device
================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS =====
-q TYPE, --quietmode=TYPE (ATA)
Set smartctl quiet mode to one of: errorsonly, silent, noserial
-d TYPE, --device=TYPE
Specify device type to one of: ata, scsi, nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, usbsunplus, marvell, areca,N/E, 3ware,N, hpt,L/M/N, megaraid,N, aacraid,H,L,ID, cciss,N, auto, test
-T TYPE, --tolerance=TYPE (ATA)
Tolerance: normal, conservative, permissive, verypermissive
-b TYPE, --badsum=TYPE (ATA)
Set action on bad checksum to one of: warn, exit, ignore
-r TYPE, --report=TYPE
Report transactions (see man page)
-n MODE, --nocheck=MODE (ATA)
No check if: never, sleep, standby, idle (see man page)
============================== DEVICE FEATURE ENABLE/DISABLE COMMANDS =====
-s VALUE, --smart=VALUE
Enable/disable SMART on device (on/off)
-o VALUE, --offlineauto=VALUE (ATA)
Enable/disable automatic offline testing on device (on/off)
-S VALUE, --saveauto=VALUE (ATA)
Enable/disable Attribute autosave on device (on/off)
-s NAME[,VALUE], --set=NAME[,VALUE]
Enable/disable/change device setting: aam,[N|off], apm,[N|off],
lookahead,[on|off], security-freeze, standby,[N|off|now],
wcache,[on|off], rcache,[on|off], wcreorder,[on|off]
======================================= READ AND DISPLAY DATA OPTIONS =====
-H, --health
Show device SMART health status
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartctl -H /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
-c, --capabilities (ATA, NVMe)
Show device SMART capabilities
-A, --attributes
Show device SMART vendor-specific Attributes and values
root@tangmingyu-QiTianM610-D529:/home/tangmingyu# smartctl -A /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-39-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 082 063 006 Pre-fail Always - 195955408
3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 110
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 066 060 045 Pre-fail Always - 5175994
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 489
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 110
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0 0 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 065 061 040 Old_age Always - 35 (Min/Max 24/35)
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 116
194 Temperature_Celsius 0x0022 035 022 000 Old_age Always - 35 (0 22 0 0 0)
195 Hardware_ECC_Recovered 0x001a 001 001 000 Old_age Always - 195955408
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 489h+26m+38.312s
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 1023618382
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 716149754
-f FORMAT, --format=FORMAT (ATA)
Set output format for attributes: old, brief, hex[,id|val]
-l TYPE, --log=TYPE
Show device log. TYPE: error, selftest, selective, directory[,g|s],
xerror[,N][,error], xselftest[,N][,selftest],
background, sasphy[,reset], sataphy[,reset],
scttemp[sts,hist], scttempint,N[,p],
scterc[,N,M], devstat[,N], ssd,
gplog,N[,RANGE], smartlog,N[,RANGE],
nvmelog,N,SIZE
-v N,OPTION , --vendorattribute=N,OPTION (ATA)
Set display OPTION for vendor Attribute N (see man page)
-F TYPE, --firmwarebug=TYPE (ATA)
Use firmware bug workaround:
none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid
-P TYPE, --presets=TYPE (ATA)
Drive-specific presets: use, ignore, show, showall
-B [+]FILE, --drivedb=[+]FILE (ATA)
Read and replace [add] drive database from FILE
[default is +/etc/smart_drivedb.h
and then /var/lib/smartmontools/drivedb/drivedb.h]
============================================ DEVICE SELF-TEST OPTIONS =====
-t TEST, --test=TEST
Run test. TEST: offline, short, long, conveyance, force, vendor,N,
select,M-N, pending,N, afterselect,[on|off]
-C, --captive
Do test in captive mode (along with -t)
-X, --abort
Abort any non-captive test on device
=================================================== SMARTCTL EXAMPLES =====
smartctl --all /dev/sda (Prints all SMART information)
smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda
(Enables SMART on first disk)
smartctl --test=long /dev/sda (Executes extended disk self-test)
smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda
(Prints Self-Test & Attribute errors)
smartctl --all --device=3ware,2 /dev/sda
smartctl --all --device=3ware,2 /dev/twe0
smartctl --all --device=3ware,2 /dev/twa0
smartctl --all --device=3ware,2 /dev/twl0
(Prints all SMART info for 3rd ATA disk on 3ware RAID controller)
smartctl --all --device=hpt,1/1/3 /dev/sda
(Prints all SMART info for the SATA disk attached to the 3rd PMPort
of the 1st channel on the 1st HighPoint RAID controller)
smartctl --all --device=areca,3/1 /dev/sg2
(Prints all SMART info for 3rd ATA disk of the 1st enclosure
on Areca RAID controller)
-------------本文结束感谢您的阅读-------------